package com.fzc.nio.jetty;/**
 * Created by fzc on 2017/9/28.
 */

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.util.CharsetUtil;

import javax.swing.*;

/**
 * 字节缓冲
 *
 * @author fzc
 * @create 2017-09-28 17:10
 **/
public class NettyByteBuffer {

    public static void main(String[] args) {
        ByteBuf buffer = Unpooled.copiedBuffer("1111".toCharArray(), CharsetUtil.UTF_8);
        for (int i = 0; i <buffer.capacity() ; i++) {
            byte b = buffer.getByte(i);
            System.out.println((char) b);
        }

    }
}
